package com.suyl.annotationdemo.model.controller;

/**
 * @author suyanlong
 * @version 1.0
 * @createDate 2020/3/30 19:56
 */
public class TestHashMap {
    public static void main(String[] args) {
//        HashMap hashMap = new HashMap();
//        for (int i = 0; i < Integer.MAX_VALUE; i++) {
//            System.out.println(i);
//            hashMap.put(String.valueOf(i), null);
//        }
//        System.out.println(hashMap.size());
//        hashMap.put("suyl", "suyl");
//        System.out.println(hashMap.size());
//        hashMap.put("candy", "candy");
//        System.out.println(hashMap.size());
        System.out.println(TestAnnotation.tableSizeFor(17225169));
        System.out.println(twoN(17225169));
        System.out.println(twoN(33554432));
    }

    public static int twoN(int num) {
        return (num >> 1) == 1 ? 1 : 1 + twoN(num >> 1);
    }
}
